//package com.zlq.javaWeb3.filter;
//
//
//import javax.servlet.*;
//import javax.servlet.annotation.WebFilter;
//import javax.servlet.annotation.WebInitParam;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpSession;
//import java.io.IOException;
//@WebFilter(urlPatterns = "/web/*")
//public class AdminFilter implements Filter {
//    @Override
//    public void init(FilterConfig filterConfig) throws ServletException {
//        Filter.super.init(filterConfig);
//    }
//
//    @Override
//    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
//        HttpServletRequest request = (HttpServletRequest) servletRequest;
//        HttpSession session = request.getSession();
//        Object user = session.getAttribute("user");
//        if (user == null){
//            request.getRequestDispatcher("oop.jsp").forward(servletRequest,servletResponse);
//            System.out.println("从新登录");
//            return;
//        }else {
//            filterChain.doFilter(servletRequest,servletResponse);
////            request.getRequestDispatcher("company.jsp").forward(servletRequest,servletResponse);
//        }
//    }
//
//
//    @Override
//    public void destroy() {
//        Filter.super.destroy();
//    }
//}
